﻿#include<iostream>
using namespace std;

struct Skill {
	char Name[48];
	int Mpp;//内力消耗
	int Spp;//怒气
	int Act;//攻击力
	int ActB;//翻倍攻击
	int CoolDown;//冷却时间
	int Lv;//技能等级
};

struct USkill {//这个结构体用于区分每个人物的冷却时间和技能开关
	Skill* skill{};//技能基本属性表
	int lv;//技能等级
	int cooldown;//冷却时间
	bool buse{};//技能开关
};

typedef struct Role {
	char Name[48];
	int Hp;
	int MaxHp;
	int Mp;
	int MaxMp;
	int Sp;
	int MaxSp;
	int Act;
	USkill skills[5];
}*PROLE;

int main() {
	Skill AllSkills[11]
	{
		{ "普通攻击",0, 0, 10, 1, 0 },
		{ "大力金刚指",10, 0, 50, 1 , 1},
		{ "云龙三观",10, 0, 60, 1, 1 },
		{ "一阳指",30, 0, 0, 2, 3 },
		{ "迎风破浪",30, 0, 300, 0, 3 },
		{ "八卦掌",50, 0, 0, 5, 4 },
		{ "六合八荒",50, 0, 500, 0, 4 },
		{ "仙人指路",100, 0, 0, 10, 6 },
		{ "横扫千军",100, 0, 50, 2, 6 },
		{ "气吞山河",0, 100, 500, 5, 0 },
		{ "秋风刀法",0, 100, 200, 10, 0 }
	};

	PROLE User = new Role{
		"郝英俊",
		1000,1000,1000,1000,0,100,100,{
			{&AllSkills[0],0,0,true},
			{&AllSkills[1],0,0,true},
			{&AllSkills[2],0,0,false},
			{&AllSkills[3],0,0,false},
			{&AllSkills[10],0,0,true}
		}
	};

	PROLE Monster = new Role{
		"奥特曼",
		1000,1000,1000,1000,0,100,100,{
			{&AllSkills[0],0,0,true},
			{&AllSkills[1],0,0,true},
			{&AllSkills[2],0,0,true},
			{&AllSkills[3],0,0,true},
			{&AllSkills[10],0,0,true}
		}
	};

	cout << "角色姓名：" << User->Name << endl;
	cout << "生命：" << User->Hp << "/" << User->Hp << endl;
	cout << "内力：" << User->Mp << "/" << User->MaxMp << endl;
	cout << "怒气：" << User->Sp << "/" << User->MaxSp << endl;
	cout << "基本攻击：" << User->Act << endl;

	for (auto skill : User->skills) {
		if (skill.buse) {
			cout
				<< "技能名称 [" << skill.skill->Name << "]"
				<< "消耗MP " << skill.skill->Mpp
				<< "消耗SP " << skill.skill->Spp
				<< "附加攻击 " << skill.skill->Act
				<< "翻倍攻击 " << skill.skill->ActB
				<< "冷却 " << skill.skill->CoolDown
				<< "技能等级 " << skill.lv
				<< endl;
		}
	}
}